load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("//pkg/testutils:buildutil/buildutil.bzl", "disallowed_imports_test")

go_library(
    name = "colflow",
    srcs = [
        "explain_vec.go",
        "flow_coordinator.go",
        "panic_injector.go",
        "routers.go",
        "stats.go",
        "vectorized_flow.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/colflow",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/col/coldata",
        "//pkg/col/coldataext",
        "//pkg/roachpb",
        "//pkg/settings",
        "//pkg/sql/catalog/descs",
        "//pkg/sql/colcontainer",
        "//pkg/sql/colexec",
        "//pkg/sql/colexec/colbuilder",
        "//pkg/sql/colexec/colexecargs",
        "//pkg/sql/colexec/colexechash",
        "//pkg/sql/colexec/colexecutils",
        "//pkg/sql/colexecerror",
        "//pkg/sql/colexecop",
        "//pkg/sql/colflow/colrpc",
        "//pkg/sql/colmem",
        "//pkg/sql/execinfra",
        "//pkg/sql/execinfra/execopnode",
        "//pkg/sql/execinfra/execreleasable",
        "//pkg/sql/execinfrapb",
        "//pkg/sql/execstats",
        "//pkg/sql/flowinfra",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/rowenc",
        "//pkg/sql/rowexec",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sessiondatapb",
        "//pkg/sql/types",
        "//pkg/util",
        "//pkg/util/admission",
        "//pkg/util/buildutil",
        "//pkg/util/grunning",
        "//pkg/util/log",
        "//pkg/util/metric",
        "//pkg/util/mon",
        "//pkg/util/optional",
        "//pkg/util/randutil",
        "//pkg/util/retry",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "//pkg/util/tracing",
        "//pkg/util/treeprinter",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_logtags//:logtags",
        "@com_github_cockroachdb_redact//:redact",
        "@com_github_marusama_semaphore//:semaphore",
    ],
)

go_test(
    name = "colflow_test",
    size = "medium",
    srcs = [
        "colbatch_scan_test.go",
        "draining_test.go",
        "main_test.go",
        "routers_test.go",
        "stats_test.go",
        "vectorized_flow_deadlock_test.go",
        "vectorized_flow_planning_test.go",
        "vectorized_flow_shutdown_test.go",
        "vectorized_flow_space_test.go",
        "vectorized_flow_test.go",
        "vectorized_meta_propagation_test.go",
        "vectorized_panic_propagation_test.go",
    ],
    embed = [":colflow"],
    deps = [
        "//pkg/base",
        "//pkg/col/coldata",
        "//pkg/col/coldataext",
        "//pkg/col/coldatatestutils",
        "//pkg/kv",
        "//pkg/multitenant/tenantcapabilities",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/settings/cluster",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/desctestutils",
        "//pkg/sql/catalog/fetchpb",
        "//pkg/sql/colcontainer",
        "//pkg/sql/colexec",
        "//pkg/sql/colexec/colbuilder",
        "//pkg/sql/colexec/colexecargs",
        "//pkg/sql/colexec/colexecjoin",
        "//pkg/sql/colexec/colexectestutils",
        "//pkg/sql/colexec/colexecutils",
        "//pkg/sql/colexecerror",
        "//pkg/sql/colexecop",
        "//pkg/sql/colflow/colrpc",
        "//pkg/sql/colmem",
        "//pkg/sql/execinfra",
        "//pkg/sql/execinfrapb",
        "//pkg/sql/flowinfra",
        "//pkg/sql/randgen",
        "//pkg/sql/rowenc",
        "//pkg/sql/sem/eval",
        "//pkg/sql/types",
        "//pkg/storage/fs",
        "//pkg/testutils",
        "//pkg/testutils/colcontainerutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/skip",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/buildutil",
        "//pkg/util/cancelchecker",
        "//pkg/util/envutil",
        "//pkg/util/hlc",
        "//pkg/util/humanizeutil",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/metric",
        "//pkg/util/mon",
        "//pkg/util/randutil",
        "//pkg/util/stop",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
    ],
)

disallowed_imports_test(
    "colflow",
    [
        "//pkg/sql/distsql",
        "//pkg/sql/rowflow",
    ],
)
